﻿using Microsoft.CodeAnalysis;

namespace Beeflys.Generator
{
    public sealed class UPropertyInfo
    {
        public string Name { get; private set; }
        public bool SupportSet { get; private set; }
        public bool SupportGet { get; private set; }

        public string SetMethodName
        {
            get { return $"set_{this.Name}"; }
        }

        public string GetMethodName
        {
            get { return $"get_{this.Name}"; }
        }

        public string Type
        {
            get; private set;
        }

        public void Parse(IPropertySymbol propertySymbol)
        {
            this.Name = propertySymbol.Name;
            this.SupportSet = propertySymbol.SetMethod != null;
            this.SupportGet = propertySymbol.GetMethod != null;
            this.Type = propertySymbol.Type.GetFullNameExt();
        }
    }
}